<?php
$this->Html->css('ruta.css', 'stylesheet', array('inline' => false, 'media' => 'print'));
$this->Html->script('fmw/default/tables', array('inline' => false));
$this->Html->script('fmw/default/files', array('inline' => false));
$this->Html->script('fmw/default/validation', array('inline' => false));
$this->Html->scriptBlock("var OP = 'V';\n var MODEL = '" . $model . "';\n var MODEL_ID = '" . $model_id . "';\n", array('inline' => false));
$this->Html->scriptBlock("var rutas = [" . implode(",", array_keys($registros)) . "];\n", array('inline' => false));
$this->Html->script('rutas/multiple', array('inline' => false));

foreach ($jsincludes as $jsinclude) {
    $this->Html->script($jsinclude, array('inline' => false));
}
?>

<?php foreach ($registros as $id => $registro): ?>
    <div class="logo_gcba">
        <img src="<?= WWW ?>img/gcba.jpg" />
    </div>

    <?php foreach ($registro['data'] as $order => $block): ?>
        <?php if ($block['type'] == 'fieldset'): ?>
            <?php echo $this->element('Rutas/fieldsets/view', array('block' => $block, 'order' => $order, 'row' => $registro['row'], 'add' => true)); ?>
        <?php elseif ($block['type'] == 'table'): ?>
            <?php echo $this->element('tables/list', array('OP' => 'V', 'table' => $block, 'order' => $order, 'add' => false)); ?>
        <?php endif; ?>
    <?php endforeach; ?>

    <div class="pageBreak">
        <br />
    </div>
<?php endforeach; ?>

<?php
//echo $this->Html->link(__('Imprimir'), 'javascript:imprimirRutas();', array('class' => 'continuar'));
echo $this->Html->link(__('Imprimir'),  'imprimir/' . $model_id, array('class' => 'continuar', 'target' => '_blank'));
echo $this->Html->link(__('Continuar'), generateUrl($return), array('class' => 'continuar'));
?>

<?php
$this->Html->scriptBlock("$(document).ready(function() {\n\t" . implode("\n\t", $this->Presentation->getJsInitial()) . "\n});", array('inline' => false));
?>